<?php

namespace RSP\ReseauSocialBundle\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * Ville
 *
 * @ORM\Table()
 * @ORM\Entity(repositoryClass="RSP\ReseauSocialBundle\Entity\VilleRepository")
 */
class Ville
{
    /**
     * @var integer
     *
     * @ORM\Column(name="id", type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    private $id;

    /**
     * @var string
     *
     * @ORM\Column(name="nom", type="string", length=255)
     */
    private $nom;
/**
     * @ORM\ManyToOne(targetEntity="RSP\ReseauSocialBundle\Entity\Pays",inversedBy="villes")
     *@ORM\joinColumn(nullable=false)
     */
     private $pays;
/**
     * @ORM\OneToMany(targetEntity="RSP\UserBundle\Entity\User",mappedBy="ville")
     *@ORM\joinColumn(nullable=false)
     */
     private $users;
     
    /**
     * Get id
     *
     * @return integer 
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Set nom
     *
     * @param string $nom
     * @return Ville
     */
    public function setNom($nom)
    {
        $this->nom = $nom;
    
        return $this;
    }

    /**
     * Get nom
     *
     * @return string 
     */
    public function getNom()
    {
        return $this->nom;
    }

    /**
     * Set pays
     *
     * @param \RSP\ReseauSocialBundle\Entity\Pays $pays
     * @return Ville
     */
    public function setPays(\RSP\ReseauSocialBundle\Entity\Pays $pays)
    {
        $this->pays = $pays;
    
        return $this;
    }

    /**
     * Get pays
     *
     * @return \RSP\ReseauSocialBundle\Entity\Pays 
     */
    public function getPays()
    {
        return $this->pays;
    }
    /**
     * Constructor
     */
    public function __construct()
    {
        $this->users = new \Doctrine\Common\Collections\ArrayCollection();
    }
    
    /**
     * Add users
     *
     * @param \RSP\UserBundle\Entity\User $users
     * @return Ville
     */
    public function addUser(\RSP\UserBundle\Entity\User $users)
    {
        $this->users[] = $users;
    
        return $this;
    }

    /**
     * Remove users
     *
     * @param \RSP\UserBundle\Entity\User $users
     */
    public function removeUser(\RSP\UserBundle\Entity\User $users)
    {
        $this->users->removeElement($users);
    }

    /**
     * Get users
     *
     * @return \Doctrine\Common\Collections\Collection 
     */
    public function getUsers()
    {
        return $this->users;
    }
    
    public function __toString() {
        return $this->nom;
    }
}